<?
$r = "../";
require_once($r."_engine/header_nocache.php");
require_once($r."_engine/c_account.php");
require_once($r."_engine/c_sp_gate.php");

/*echo '
<h1 style="padding-top: 100;"><center>Hello world!!!</center></h1>
';
die();*/

$account = GetActiveAccount();

$monitor = new CMonitor();
$monitor->LoadById($monitor_id);

if ($monitor->data["account_id"] != $account->id) die("Access denied") /*TODO*/;


$highlight_font_color	= $monitor->data["highlight_font_color"];
$highlight_bk_color		= $monitor->data["highlight_bk_color"];
$highlight_font_style	= $monitor->data["highlight_font_style"];

if (isset($do_hl) && $do_hl == "0")
{
	$highlight_font_color	= -1;
	$highlight_bk_color		= -1;
	$highlight_font_style	= 0;
}

$spg = new CSPGate();
$r = $spg->GetDiffHighLight($monitor_id, $resource_prev_id, $resource_id,
	$highlight_font_color, $highlight_bk_color, $highlight_font_style,
	$dhl_type);

if ($dhl_type == DHL_TYPE_ALL_PAGE)
{
	echo $r["diff_result"];
	exit();
}
?>


<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>

<?=$r["diff_result"]?>

</body>
</html>